// 投递相关的接口函数
import request from '@/utils/http.js'

//1.添加投递
export const addSendAPI=(job_id,student_id,enterprise_id)=> {
    return request({
        url: '/send/addSend',
        method: 'post',
        params: {
            jobId:job_id,
            studentId:student_id,
            enterpriseId:enterprise_id
        }
    })
}

//2.取消投递
export const deleteSendAPI=(job_id,student_id)=> {
    return request({
        url: '/send/deleteSend',
        method: 'post',
        params: {
            jobId:job_id,
            studentId:student_id
        }
    })
}

//3.查看是否已投递
export const querySendAPI=(job_id,student_id)=> {
    return request({
        url: '/send/querySend',
        method: 'post',
        params: {
            jobId:job_id,
            studentId:student_id
        }
    })
}

//4.分页查询已投递的职位
export const pageSendJobAPI=(data)=> {
    return request({
        url: '/send/pageSendJob',
        method: 'post',
        data: {
            pageCurrent: data.pageCurrent,
            pageSize: data.pageSize,
            enterpriseId:data.enterpriseId,
            sendStatus:data.sendStatus
        }
    })
}

//5.分页查询已投递的学生
export const pageSendStudentAPI=(data)=> {
    return request({
        url: '/send/pageSendStudent',
        method: 'post',
        data: {
            pageCurrent: data.pageCurrent,
            pageSize: data.pageSize,
            studentStatus:0,//没有封禁的学生
            enterpriseId: data.enterpriseId,
            jobId:data.jobId,
            studentHighestEducation:data.studentHighestEducation,
            studentAddress:data.studentAddress,
            searchName:data.searchName
        }
    })
}
//6.查询投递的数据量
export const querySendCountAPI=(enterprise_id,send_status)=> {
    return request({
        url: '/send/querySendCount',
        method: 'post',
        params: {
            enterpriseId:enterprise_id,
            sendStatus:send_status
        }
    })
}
//7.修改投递状态-已回复
export const updateSendStatusAPI=(job_id,student_id,send_status)=> {
    return request({
        url: '/send/updateSendStatus',
        method: 'post',
        params: {
            jobId:job_id,
            studentId:student_id,
            sendStatus:send_status
        }
    })
}